home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / castools.zip / FAX.H < prev    next >
Text File  |  1990-01-05  |  6KB  |  158 lines

  1. /*  FAX.H    Header file for the CAS Toolkit high-level functions. =============
  2.  
  3.     Defines structures and constants used in Intel/DCA Communicating
  4.     Applications Specification 1.0 Toolkit.
  5.  
  6.     This file, as well as FAXGLOB.H,  must be included in any application
  7.     source files that use CAS Toolkit functions whose names begin with FAX-.
  8.  
  9.     Applications that use only the Toolkit functions that begin with CAS- need
  10.     only include the header file CAS.H.
  11. ==============================================================================*/
  12. /*
  13.     FILE TRANSFER RECORD LIST structure:  This is a component of the
  14.     high-level structure ECS that is input to function FAXSubmitTask.  The ECS
  15.     structure is also used by functions FAXSend, FAXCopyECS and FAXFreeECS.
  16.  
  17.     This File Transfer Record List structure is itself the output of function
  18.     FAXGetEventFileInfo.
  19. */
  20. typedef struct FTRLIST {
  21.     FTR      OneFTR;                     /* A File Transfer Record */
  22.     struct FTRLIST *next;                /* Connector for linked list */
  23. } FTRLIST;
  24.  
  25. /*
  26.     FILE LIST structure:  Input to functions FAXSend and FAXSubmitTask.
  27. */
  28. typedef struct FILELIST{
  29.     char FileName[80];          /* Complete ASCII path and name of file */
  30.     BYTE FileType;              /* ASCII, PCX, or DCX, relevant only for Fax */
  31.     struct FILELIST *next;      /* next file in list */
  32. } FILELIST;
  33.  
  34. /*
  35.    EVENT CONTROL structure:  Input to function FAXSubmitTask.  Also used by
  36.    functions FAXSend, FAXCopyECS and FAXFreeECS.
  37.  
  38.    This Event Control Structure is also the output from function
  39.    FAXGetEventControlInfo.
  40. */
  41. typedef struct ECS{
  42.     ECF     EventControlFile;           /* CAS Task Control File  */
  43.     char    *CoverPageText;             /* Variable length  optional cover */
  44.     FTRLIST *FirstFTR;                  /* List of File Transfer Records */
  45. } ECS;
  46.  
  47. /*
  48.     DEFAULT Event Control Structure and File Transfer Record, defined with
  49.     initial values in FAXDFLTS.H.
  50. */
  51. extern FTRLIST DefaultsFTRL;
  52. extern ECS DefaultsECS;
  53.  
  54. /* ERROR HANDLING */
  55.  
  56. /*
  57.     Error Table structure:  A mapping of the CAS error codes with appropriate
  58.     messages and CAS error classes.
  59. */
  60. typedef struct {
  61.   int errorcode;
  62.   char *msg;
  63.   int errorclass;
  64. } ErrorTable;
  65.  
  66. /* Error Message structures defined in FAXERROR.H */
  67. extern char *FAXerrlist[];
  68. extern ErrorTable CASerrors[];
  69.  
  70. /* Global variables */
  71. extern int FAXerrno;
  72. extern int CASerrorcode;
  73.  
  74. /* Error Constants */
  75. #define MSGLENGTH 80               /* The maximum error message size */
  76. #define  CASnerrors       55       /* The # of entries in CASerrors[] */
  77. #define  SUCCESS          1
  78. #define  FAIL             0
  79.  
  80. /* CAS Error Classes */
  81. #define FAXWARNING         0
  82. #define DOSWARNING         1
  83. #define FATALERROR         2
  84. #define FATALDOSERROR      3
  85. #define FAXERROR           4
  86.  
  87. /* Additional Toolkit Error Classes */
  88. #define TOOLKITERROR       6
  89. #define UNKNOWNCASERROR    7
  90. #define NOERROR            8
  91.  
  92. /* Values of Toolkit error variable FAXerrno */
  93. #define  LSEEKERROR                 23
  94. #define  OUTOFMEMORY                24
  95. #define  CANTOPENFILE               25
  96. #define  CANTWRITEFILE              26
  97. #define  CANTREADFILE               27
  98. #define  CANTCLOSEFILE              28
  99. #define  BADFILECOUNT               29
  100. #define  ORPHANWARNING              30
  101. #define  EVENTNOTFOUND              31
  102. #define  FILECOUNTOUTOFRANGE        32
  103. #define  NOTTHATMANYFILES           33
  104. #define  EVENTWASCURRENT            34
  105. #define  BADSTATUS                  35
  106. #define  LOSTFTRS                   36
  107. #define  UNEXPECTEDEOF              37
  108. #define  MOREFTRSTHANFC             38
  109. #define  STRINGTOOLONG              39
  110. #define  INVALIDPTR                 40
  111. #define  BADEVENTTYPE               41
  112. #define  BADTRANSFERTYPE            42
  113. #define  FIELDZEROED                43
  114. #define  BADEVENTTIME               44
  115. #define  BADEVENTDATE               45
  116. #define  BADPHONENUMBER             46
  117. #define  NONASCIISTRING             47
  118. #define  BADSENDCOVER               48
  119. #define  FTRFIELDZEROED             49
  120. #define  FTRBADFILETYPE             50
  121. #define  FTRBADTEXTSIZE             51
  122. #define  FTRBADPAGELENGTH           52
  123. #define  FTRNONASCIISTRING          53
  124. #define  RESERVEDFIELDZEROED        54
  125. #define  FTRRESERVEDZEROED          55
  126. #define  FTRBADPAGEINCREMENTS       56
  127. #define  LOGOFILENOTFOUND           57
  128. #define  FILETOSENDNOTFOUND         58
  129. #define  INVALIDDEFAULTS            59
  130. #define  INVALIDECS                 60
  131. #define  NOCOVERTEXT                61
  132. #define  EVENTISCURRENT             62
  133. #define  RECEIVEDFAXNOCOVER         63
  134. #define  LASTMESSAGE                64
  135.  
  136. /* CAS Toolkit function prototypes */
  137. extern int       pascal FAXSend(char *To, char *PhoneNumber, FILELIST *files, CAS_DATE *date, CAS_TIME *time);
  138. extern int       pascal FAXSubmitTask(ECS *TaskSettings, char *To, char *PhoneNumber, FILELIST *files, CAS_DATE *date, CAS_TIME *time);
  139. extern ECS *     pascal FAXCopyECS(ECS *SourceECS, ECS *CopyECS);
  140. extern int       pascal FAXFreeECS(ECS *SourceECS);
  141. extern int       pascal FAXCancelTask(int EventHandle);
  142. extern ECF *     pascal FAXGetEventControlInfo(int EventHandle, BYTE *queue, ECF *EventInfo);
  143. extern char *    pascal FAXGetEventCover(int EventHandle, BYTE *queue, char *CoverPtr);
  144. extern FTRLIST * pascal FAXGetEventFileInfo(int EventHandle, BYTE *queue, FTRLIST *FTRs, int WhichFTRFirst, int *HowManyFTRs);
  145.  
  146. /* Error handling function prototype */
  147. extern char * pascal FAXError(char *MessageIn, char *MessageOut, int *ErrorClass);
  148.  
  149. /* Utility function prototypes */
  150. extern int       pascal SubmitSingleOk(ECS *task);
  151. extern int       pascal ECSOkToSubmit(ECS *ecs);
  152. extern int       pascal SFTROkToSubmit(SFTR *sftr);
  153. extern int       pascal FTRLOkToSend(ECS *ecs, FTRLIST *ftrl);
  154. extern void      pascal free_FTRLIST(FTRLIST *ftrl);
  155. extern void      pascal freeup(ECS *ecs);
  156. extern int       pascal ValidTime(CAS_TIME *time);
  157. extern int       pascal ValidDate(CAS_DATE *date);
  158.